package IC.AST;

import java.util.LinkedList;

public class LibraryMethod extends ASTNode
{
	
	private String _id;
	private Type _returnType;
	private LinkedList<Formal> _formals;
	
	public Object Visit (Visitor visitor) { return visitor.Visit(this); }
	
	public LibraryMethod (Interval interval, Type returnType, String id, LinkedList<Formal> formals)
	{
		super(interval);
		_id = id;
		GiveBirth(returnType);
		_returnType = returnType;
		_formals = (formals == null) ? new LinkedList<Formal>() : formals;
		for (Formal formal : _formals)
			GiveBirth(formal);
	}
	
	public String GetID() { return new String(_id); }
	public Type GetReturnType() { return _returnType; }
	public LinkedList<Formal> GetFormals() { return _formals; }
}
